<template>
  <div class="childBank">
    <header>
      <div class="container">
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item >生涯规划</el-breadcrumb-item>
          <el-breadcrumb-item>生涯宝库</el-breadcrumb-item>
          <el-breadcrumb-item>{{type}}</el-breadcrumb-item>
        </el-breadcrumb>
      </div>
    </header>
    <main>
      <div class="container">
        <el-tabs v-model="activeName" @tab-click="checkTag">
          <el-tab-pane :lazy="true" label="专业信息库" name="0">
            <majorBank />
          </el-tab-pane>
          <el-tab-pane :lazy="true" label="职业信息库" name="1">
            <careerBank />
          </el-tab-pane>
          <el-tab-pane :lazy="true" label="院校信息库" name="2">
            <collegeBank />
          </el-tab-pane>
        </el-tabs>
      </div>
    </main>
  </div>
</template>

<script>
  import majorBank from './majorBank'
  import careerBank from './careerBank'
  import collegeBank from './collegeBank'
    export default {
        name: "childBank",
        data() {
            return {
                type: '',
                activeName: this.$route.query.type,
            }
        },
        components: {
            majorBank,
            careerBank,
            collegeBank
        },
        created() {
            this.createBread(); // 面包屑
        },
        mounted() {

        },
        methods: {
            // 面包屑
            createBread() {
                const type = this.$route.query.type;
                switch (type) {
                   case '0':
                      this.type = '专业信息库';
                      break;
                   case '1':
                      this.type = '职业信息库';
                      break;
                   case '2':
                      this.type = '院校信息库';
                      break;
                }
            },
            // 选择tag
            checkTag(tab) {
                // console.log(tab);
                // 面包屑
                this.type = tab.label;
            }
        }
    }
</script>

<style scoped lang="scss">
  @import '../../../styles/common.scss';
  // header
  header{
    padding: 20px 0;
  }
  main{
    background-color: #fff;
  }
</style>